useUpdateEffect()
import React, {useState, useEffect, useCallback, useRef} from 'react'
export default function useUpdateEffect(callback, dependencies) {
const firstRenderRef = useRef(true)
useEffect(() => {
if(firstRenderRef.current) {
firstRenderRef.current = false
return
}
return callback()
}, dependencies)
}